import http from "@/utils/http";

/**
 * 加入购物车
 * @returns 
 */
export function addCart(data) {
    return http({
        url: '/member/cart',
        method: 'post',
        data,
    })
}

/**
 * 购物车列表
 * @returns 
 */
export function cartList() {
    return http({
        url: '/member/cart',
    })
}

/**
 * 修改购物车商品
 * @returns 
 */
export function modifiCart(id, data) {
    return http({
        url: `/member/cart/${id}`,
        method: 'PUT',
        data,
    })
}

/**
 * 购物车全选/取消全选
 * @returns 
 */
export function selectedCartAll(data) {
    return http({
        url: `/member/cart/selected`,
        method: 'PUT',
        data,
    })
}

/**
 * 删除/清空购物车商品
 * @returns 
 */
export function deleteCart(data) {
    return http({
        url: `/member/cart`,
        method: 'DELETE',
        data,
    })
}
